<template>
  <div>
    <h2>首页</h2>
    <ul>
      <li><router-link to="/public-activities">公开活动列表</router-link></li>
      <li v-if="isAdmin"><router-link to="/activity-management">活动管理</router-link></li>
    </ul>
  </div>
</template>

<script setup>
import { computed } from 'vue'
import { useRouter } from 'vue-router'

const router = useRouter()
const isAdmin = computed(() => localStorage.getItem('role') === 'admin')
</script>